package com.ln.dm1104.demo02;

import java.util.function.Function;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/4 16:15
 */
public class Test04 {
    public static void main(String[] args) {
//        Function<String,Student> function=t->new Student(t);
        Function<String,Student> function=Student::new;

        Student student = function.apply("王德法");
        System.out.println(student);
    }
}
class Student{
    private String name;

    public Student() {
    }

    public Student(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                '}';
    }
}